package com.example.main.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.main.controller.vo.UserVO;
import com.example.main.dao.UserMapper;
import com.example.main.entity.UserEntity;
import com.example.main.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @NAME: WSC
 * @DATE: 2021/12/14
 * @DESCRIBE:
 **/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> implements UserService {
    @Override
    public boolean login(UserVO userVO) {
        LambdaQueryWrapper<UserEntity> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(UserEntity::getUsername, userVO.getUsername());
        wrapper.eq(UserEntity::getUserpwd, userVO.getUserpwd());

        UserEntity ret = this.getOne(wrapper);
        return ret != null;
    }
}
